<?php 
  //$user = new User();
?> 

<form action="<?php echo WebRoot ?>settings.php" method="post">
  <fieldset id="settings-changepass">
    <legend><?php echo T_('Change password'); ?></legend>
    <input type="hidden" id="registerEmail" value="<?php echo $user->EMail;?>" />
    
    <label for="oldPassword"><?php echo T_('Old password');?></label><br />
    <input type="password" id="oldPassword" name="password[OldPassword]" value="<?php isset($generatedPass) ? $generatedPass : ''; ?>"/><br />             
    
    <label for="registerPassword"><?php echo T_('New password');?></label><br />
    <input type="password" id="registerPassword" name="password[NewPassword]" />
    <span id="registerPasswordResult"></span><br />               
    
    <label for="repeatPassword"><?php echo T_('Repeat password');?></label><br />
    <input type="password" id="repeatPassword" name="password[RepeatPassword]" /><br />
    
    <input type="submit" name="password[submit]" value="<?php echo T_('Change password');?>" />
    <div>
      <?php echo T_('Keep your account safe by using a strong password.'); ?><br />
      <?php echo T_('Including uppercase and lowercase letters, as well as numbers and symbols, can help make a password stronger.'); ?>
    </div>
  </fieldset>
</form>

<div class="clear"></div>

<form action="<?php echo WebRoot ?>settings.php" method="post" enctype="multipart/form-data">
  <fieldset id="settings-personal">
    <legend><?php echo T_('Personal info'); ?></legend>
    <div>
      <?php echo T_('All personal informations, excluding your e-mail address, will be visible on your Profile page.'); ?>
    </div>
    <label for="formDisplayName"><?php echo T_('Display Name');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('Display name appears in your albums and comments. It\'s not used to login!')?>" type="text" id="formDisplayName" name="personal[displayName]" value="<?php echo $user->UserName;?>" />
    <img id="formDisplayNameLoading" src ="<?php echo WebRoot; ?>/themes/<?php echo $theme; ?>/images/loading.gif" alt="loading" />
    <span id="formDisplayNameResult"></span><br />  
   
    <label for="formFirstName"><?php echo T_('First Name');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('First name appears only on your profile')?>" type="text" id="formFirstName" name="personal[firstName]" value="<?php echo $user->FirstName;?>" /><br />
    
    <label for="formLastName"><?php echo T_('Last Name');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('Last name appears only on your profile')?>" type="text" id="formLastName" name="personal[lastName]" value="<?php echo $user->LastName;?>" /><br />
    
    <label for="formGender"><?php echo T_('Gender');?></label><br />
    <select id="formGender" name="personal[gender]">
      <option value="-">-</option>
      <option <?php if($user->Gender == 'male') echo 'selected="selected"' ?> value="male"><?php echo T_('Male'); ?></option>
      <option <?php if($user->Gender == 'female') echo 'selected="selected"' ?> value="female"><?php echo T_('Female'); ?></option>
    </select><br/>
    
    <label for="formICQ"><?php echo T_('ICQ');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('Your icq number')?>" type="text" id="formICQ" name="personal[icq]" value="<?php echo $user->ICQ;?>" /><br />
    
    <label for="formJabber"><?php echo T_('Jabber');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('Your Jabber account')?>" type="text" id="formJabber" name="personal[jabber]" value="<?php echo $user->Jabber;?>" /><br />
    
    <label for="formUrl"><?php echo T_('Web');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('Your web page')?>" type="text" id="formUrl" name="personal[url]" value="<?php echo $user->WebPage;?>" /><br />
    
    <label for="formAvatar"><?php echo T_('Change avatar');?></label><br />
    <input class="tooltipTitle" title="<?php echo T_('You can change your avatar. Avatar is displayed along with your comments.')?>" type="file" id="formAvatar" name="avatar" /><br />
    <!--
    <select name="personal[language]">
      <?php        
        $lang = $db->getRepository('Language')->findAll();
        foreach($lang as $value) {
          echo '<option ';
          if ($value == $user->Language) echo 'selected="selected "';
          echo 'value="'.$value->Language.'">'.$value->FullName.'</option>';
        }
      ?>
    </select><br />-->
    <label for="formDetails"><?php echo T_('Aditional info');?></label><br />
    <textarea class="tooltipTitle" title="<?php echo T_('You can tell something about yourself, or you name it')?>" id="formDetails" name="personal[details]" rows="3" cols="40"><?php echo $user->Details ?></textarea><br/>
    
    <input type="submit" name="personal[submit]" value="<?php echo T_('Update');?>" />
  </fieldset>
</form>

<div class="clear"></div>

<div id="settings-themes">
<h4><?php echo T_('Change theme'); ?></h4>
<p><?php echo T_('Hint: pointing to the name of the style will only show the live preview. If you want to set the theme, then you have to click on it') ?></p>
<?php
  $result = $db->getRepository('Style')->findAll();
  foreach ($result as $value) {
?>   
    <div class="settings-theme">
      <a class="changestyle" rel="<?php echo $value->idStyle ?>" href="<?php echo WebRoot ?>controllers/setStyle.php?style=<?php echo $value->idStyle?>">
        <?php echo ($value->idStyle == $theme) ? "<strong>$value->FullName</strong>" : $value->FullName ?>
      </a>
      <p><?php echo $value->Description ?></p>
    </div>
<?php    
  }
?>
</div>
